var movable = new Object("movable","#FFF","#9F0",movableAction,movableDraw);

//przesuwanie klocka
function movableAction(x,y,direction)
{
	if(direction == 0 && window.game.table[x][y-1] == 0 )
	{
		window.game.table[x][y-1] = window.game.table[x][y];
		window.game.table[x][y] = 0;
		return true;
	}
	else if(direction == 1 && window.game.table[x+1][y] == 0 )
	{
		window.game.table[x+1][y] = window.game.table[x][y];
		window.game.table[x][y] = 0;
		return true;
	}
	else if( direction == 2 && window.game.table[x][y+1] == 0 )
	{
		window.game.table[x][y+1] = window.game.table[x][y];
		window.game.table[x][y] = 0;
		return true;
	}
	else if( direction == 3 && window.game.table[x-1][y] == 0 )
	{
		window.game.table[x-1][y] = window.game.table[x][y];
		window.game.table[x][y] = 0;
		return true;
	}
	return false;
}

function movableDraw(context,x,y,width,height)
{
	
}
window.game.addObject( movable );